pub fn dp_rec_mc(amount: u32) -> u32 {
    // 如果金额为0，直接返回0
    if amount == 0 {
        return 0;
    }
    
    // 可用的纸币面值
    const BILLS: [u32; 8] = [1, 2, 5, 10, 20, 30, 50, 100];
    
    // 创建动态规划数组，初始化为最大值
    let mut dp = vec![u32::MAX; (amount + 1) as usize];
    // 基础情况：金额0需要0张纸币
    dp[0] = 0;
    
    // 对每个金额进行计算
    for i in 1..=amount as usize {
        // 尝试每种纸币
        for &bill in BILLS.iter() {
            if bill <= i as u32 {
                // 如果子问题有解且不会溢出
                if dp[i - bill as usize] != u32::MAX && dp[i - bill as usize] < u32::MAX - 1 {
                    dp[i] = dp[i].min(dp[i - bill as usize] + 1);
                }
            }
        }
    }
    
    dp[amount as usize]
}
